{include file=member.header.html}
{include file="title.html"}
{include file=member.submenu.html}

<script>
    $(function() {
        $('#refund_form').submit(function() {
            if ($('textarea[name="content"]').val() == '') {
                alert(lang.message_cannot_empty);
                return false;
            }
        });
    });
</script>


<style>
    .refund_view .red_btn{cursor: pointer;margin-bottom:10px;}
</style>


<ul class="form_content refund_view">
    <li>
        <h3>{$lang.refund_number}</h3>
        <p>{$refund.refund_sn}</p>
    </li>
    <li>
        <h3>{$lang.apply_date}</h3>
        <p>{$refund.created|date:Y-m-d H:i:s}</p>
    </li>
    <li>
        <h3>{$lang.refund_status}</h3>
        <p>
            {if $refund.status=='CLOSED'}{$lang.refund_colse}
            {elseif $refund.status=='SUCCESS'}{$lang.refund_succed}
            {elseif $refund.status=='FAILED'}{$lang.refund_fail}
            {elseif $refund.status=='WAIT_SELLER_AGREE'}{$lang.buyer_apply_refund}
            {elseif $refund.status=='SELLER_REFUSE_BUYER'}{$lang.seller_refused_refund}
            {elseif $refund.status=='WAIT_ADMIN_AGREE'}{$lang.seller_agree_refund}
            {elseif $refund.status=='WAIT_SELLER_CONFIRM'}{$lang.refund_apply_wait}
            {/if}	
        </p>
    </li>
    <li>
        <h3>{$lang.goods_amount}</h3>
        <p>{$refund.total_fee|price}</p>
    </li>
    <li>
        <h3>{$lang.goods_refund_amount}</h3>
        <p>{$refund.refund_fee|price}</p>
    </li>
    
    <li>
        <h3>{$lang.refund_money}</h3>
        <p>{$refund.refund_goods_fee|price}({$lang.goods_amount}：{$refund.goods_fee|price})</p>
    </li>
    <li>
        <h3>{$lang.trip_back}</h3>
        <p>{$refund.refund_shipping_fee|price} ({$lang.travelling_expenses}：{$refund.shipping_fee|price})</p>
    </li>
    <li>
        <h3>{$lang.receive_cond}</h3>
        <p>{$refund.refund_shipped}</p>
    </li>
    <li>
        <h3>{$lang.refund_reason}</h3>
        <p>{$refund.refund_reason}</p>
    </li>
    <li>
        <h3>{$lang.refund_instruction}</h3>
        <p>{$refund.refund_desc}</p>
    </li>
    <li>
        <!--{if $refund.status neq 'SUCCESS' && $refund.status neq 'CLOSED' && $refund.status neq 'WAIT_ADMIN_AGREE'}-->
        <!--{if $refund.buyer_id==$visitor.user_id}-->
        <a href="{url app=refund&act=cancel&refund_id=$refund.refund_id}" onclick="return confirm('{$lang.cancel_confirm}')" class="red_btn">{$lang.cancel_refund}</a>
        <a href="{url app=refund&act=edit&refund_id=$refund.refund_id}" class="red_btn">{$lang.modify_refund}</a>
        <!--{else}-->
        <a href="{url app=refund&act=agree&refund_id=$refund.refund_id}" class="red_btn" onclick="return confirm('{$lang.agree_refund_info}')">{$lang.agree_refund}</a>
        <a href="{url app=refund&act=refuse&refund_id=$refund.refund_id}" class="red_btn">{$lang.refused_refund}</a>
        <!--{/if}-->
        <!--{if $refund.ask_customer!=1}-->
        <a class="red_btn" onclick="return confirm('{$lang.customer_confirm}');" href="{url app=refund&act=ask_customer&refund_id=$refund.refund_id}">{$lang.customer_invol}</a>
        <!--{else}-->
        <span>{$lang.customer_has_deal}</span>
        <!--{/if}-->
        <!--{/if}-->
    </li>
    <li>
        <!--{if $refund.status neq 'SUCCESS' && $refund.status neq 'CLOSED'}-->
        <form method="post" enctype="multipart/form-data" id="refund_form">
            <h3>{$lang.upload_document}：</h3>
            <p><input type="file" name="refund_cert" /></p>
            <h3>{$lang.upload_document}：</h3>
            <p><textarea name="content" class="text" style="height:60px;"></textarea></p>
            <input type="submit" name=""  value="{$lang.submit}" class="red_btn"/>
        </form>
        <!--{/if}-->
    </li>
</ul>
<ul class="form_content">
    <li>
        <h3>{$lang.record}：</h3>
    </li>
    <!--{foreach from=$refund.message item=message name=fe_message}-->
    <li>
        <h3>
            {if $message.owner_id==$visitor.user_id}
            {$lang.self}
            {elseif $message.owner_role eq 'buyer'}
            {$lang.buyer}
            {elseif $message.owner_role eq 'seller'}
            {$lang.seller}
            {elseif $message.owner_role eq 'admin'}
            {$lang.merchant_service}
            {/if}
            <span>{$message.created|date:Y-m-d H:i:s}</span>
        </h3>
        <p>
            {$message.content}
        </p>
        <!--{if $message.pic_url}-->
        <p style="margin-top:10px;"><img src="{$site_url}/{$message.pic_url}" width="200" /></p>
        <!--{/if}-->
        </p>
    </li>
    <!--{/foreach}-->  
    
</ul>
{include file=member.page.bottom.html}







{include file=footer.html}